﻿<%@ Page Language="VB" AutoEventWireup="false" CodeFile="popUpMateriales.aspx.vb" Inherits="Interfaz_popUpMateriales" %>

<%@ Register Assembly="AjaxControlToolkit" Namespace="AjaxControlToolkit" TagPrefix="cc1" %>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<html xmlns="http://www.w3.org/1999/xhtml" >
<head runat="server">
<link rel="stylesheet" media="screen,projection" type="text/css" href="../Otros/css/main.css" />
    <title>Insertar materiales</title>
          
  <script type="text/javascript">
        function ValidNum(e) {
        var tecla = document.all ? tecla = e.keyCode : tecla = e.which;
        return ((tecla > 47 && tecla < 58) || tecla == 46);                             
        }
        window.onunload=function(){
            window.opener.document.getElementById('ctl00_ContentPlaceHolder1_BtnUpdateCampos').click(); 
        };
        
        function OnCurrencyValueKeyUp(input)
        { 
        if(input.value.toString().length == 1 && input.value.toString() == '0') 
        input.value = input.value.replace('0',''); 

        var num = input.value.replace('.','');
        num = input.value.replace(/\,/g,'');
        if((!isNaN(num)|| num=='-') && num != '-0')
        {
        if(num.indexOf('.') > -1)
        {
        num = num.split('.');
        num[0] = num[0].toString().split('').reverse().join('').replace(/(?=\d*\.?)(\d{3})/g,'$1,').split('').reverse().join('').replace(/^[\,]/,'');
        if(num[1].length > 2)
        {
        num[1] = num[1].substring(0,num[1].length-1);
        }
        input.value = num[0]+'.'+num[1]; 
        }
        else
        {
        input.value = num.toString().split('').reverse().join('').replace(/(?=\d*\.?)(\d{3})/g,'$1,').split('').reverse().join('').replace(/^[\,]/,'') };
        }
        else
        {
        input.value = input.value.substring(0,input.value.length-1);
        }
        input.value = input.value.toString().replace(/\$|\ /g,'');
        input.value = input.value.toString().replace('.','');
        input.value = input.value.toString().replace('-,','-');    
}

        function addsimbol(input,op){
        
        if(input.value.charAt(0)!=("$") && input.value.length>0 &&op==1){
        input.value = "$"+input.value.toString();
        }
        if(input.value.charAt(input.value.length-1)!=("%") && input.value.length>0 && op==2){        
        var a=input.value.toString().replace("%","")
        input.value = a+"%";
        }
        }


  </script>
  
  
</head>
<body>
    <form id="form1" runat="server">
    <div>     
         
    </div>
         <table style="width: 100%; background-color: white; border-right: lightblue thin solid; border-top: lightblue thin solid; border-left: lightblue thin solid; border-bottom: lightblue thin solid;">
            <tr>
                <td>
                    <table style="width: 100%; border-bottom: mediumblue thin double; background-color: white">
                        <tr>
                            <td style="width: 100%; text-align: left">
                                <strong>DETALLE MATERIALES</strong></td>
                        </tr>
                    </table >
                                <table style="width: 100%">
                                    <tr>
                                        <td style="width: 210px; text-align: justify">
                                            <strong style="width: 24%">Seleccione Proveedor</strong></td>
                                        <td style="width: 1%; text-align: left">
                                            :</td>
                                        <td style="width: 25%; text-align: left">
                                            <asp:DropDownList ID="DropProveedorMat" runat="server" Width="200px" AutoPostBack="True">
                                            </asp:DropDownList>
                                            <asp:RequiredFieldValidator ID="RequiredFieldValidator1" runat="server" ControlToValidate="DropProveedorMat"
                                                ErrorMessage="RequiredFieldValidator" InitialValue="Elija Proveedor">*</asp:RequiredFieldValidator></td>
                                        <td style="width: 24%; text-align: left">
                                            </td>
                                        <td style="width: 1%; text-align: left">
                                        </td>
                                        <td style="width: 25%; text-align: left">
                                        </td>
                                    </tr>
                                    <tr>
                                        <td style="width: 210px; text-align: justify">
                                            <strong>Material espera &nbsp;&nbsp;<asp:ScriptManager ID="ScriptManager1" runat="server">
                                            </asp:ScriptManager>
                                                <cc1:PopupControlExtender ID="PopupControlExtender1" runat="server" TargetControlID="Image1" PopupControlID ="Panel1" OffsetX="1" OffsetY="1">
                                                </cc1:PopupControlExtender>
                                                &nbsp;<asp:Image ID="Image1" runat="server" Height="28px" ImageUrl="~/Interfaz/Otros/Imagenes/boton-verde-claro-md.png"
                                                    Width="35px" /><br />
                                                &nbsp;&nbsp;&nbsp;
                                                <asp:Panel ID="Panel1" runat="server" BorderColor="Red" BorderStyle="Solid">
                                                    <table style="width: 381px; border-bottom: mediumblue thin double; background-color: white">
                                                        <tr>
                                                            <td style="width: 412px; height: 357px">
                                                                <table style="border-bottom: mediumblue thin double; background-color: white">
                                                                    <tr>
                                                                        <td style="width: 357px; text-align: left">
                                                                            <strong>AGREGAR ITEM</strong></td>
                                                                    </tr>
                                                                </table>
                                                                <table style="width: 370px">
                                                                    <tr>
                                                                        <td style="width: 145px; height: 20px; text-align: left">
                                                                            Nombre :</td>
                                                                        <td style="width: 201px; height: 20px; text-align: left">
                                                                            <asp:TextBox ID="Txtnom" runat="server" Width="192px"></asp:TextBox>
                                                                        </td>
                                                                    </tr>
                                                                    <tr>
                                                                        <td style="width: 145px; text-align: left">
                                                                            Descripcion Formal :</td>
                                                                        <td style="width: 201px; text-align: left">
                                                                            <asp:TextBox ID="TxtDescFormal" runat="server" Width="192px"></asp:TextBox></td>
                                                                    </tr>
                                                                    <tr>
                                                                        <td style="width: 145px; text-align: left">
                                                                            Descripcion Informal :</td>
                                                                        <td style="width: 201px; text-align: left">
                                                                            <asp:TextBox ID="TxTDescInformal" runat="server" Width="192px"></asp:TextBox></td>
                                                                    </tr>
                                                                    <tr>
                                                                        <td style="width: 145px; text-align: left">
                                                                            Stock Minimo :</td>
                                                                        <td style="width: 201px; text-align: left">
                                                                            <asp:TextBox ID="TxTStockMinimo" runat="server" Width="192px"></asp:TextBox></td>
                                                                    </tr>
                                                                    <tr>
                                                                        <td style="width: 145px; text-align: left">
                                                                            Familia :</td>
                                                                        <td style="width: 201px; text-align: left">
                                                                            <asp:DropDownList ID="DropFamilia" runat="server" Width="200px">
                                                                            </asp:DropDownList></td>
                                                                    </tr>
                                                                    <tr>
                                                                        <td style="width: 145px; text-align: left">
                                                                            Proveedor Sugerido :</td>
                                                                        <td style="width: 201px; text-align: left">
                                                                            <asp:DropDownList ID="DropProv" runat="server" Width="200px">
                                                                            </asp:DropDownList></td>
                                                                    </tr>
                                                                </table>
                                                                <table style="border-right: blue thin solid; border-top: blue thin solid; border-left: blue thin solid;
                                                                    width: 370px; border-bottom: blue thin solid; position: static" id="TABLE1" onclick="return TABLE1_onclick()">
                                                                    <tr>
                                                                        <td style="text-align: center; width: 137px;">
                                                                            <asp:Button ID="Button1" runat="server" Text="Ingresar" /></td>
                                                                        <td style="text-align: center; width: 156px;">
                                                                            <asp:Button ID="Button3" runat="server" Text="Limpiar" /></td>
                                                                    </tr>
                                                                </table>
                                                            </td>
                                                        </tr>
                                                    </table>
                                                </asp:Panel>
                                            </strong></td>
                                        <td style="width: 241px; text-align: left">
                                            :</td>
                                        <td style="width: 241px; text-align: left">
                                            <asp:CheckBox ID="CBMateEsp" runat="server" AutoPostBack="True" Width="96px" /><asp:DropDownList ID="DropItemMatEspera" runat="server" Width="96px">
                                            </asp:DropDownList></td>
                                        <td style="width: 82px; text-align: justify">
                                            <strong>Material Stock </strong></td>
                                        <td style="width: 82px; text-align: justify">
                                            :</td>
                                        <td>
                                            <asp:CheckBox ID="CBMateStock" runat="server" AutoPostBack="True" />
                                            <asp:DropDownList
                                                ID="DropItemMatStock" runat="server" Width="112px">
                                            </asp:DropDownList></td>
                                    </tr>
                                    <tr>
                                        <td style="width: 210px; text-align: justify">
                                            <strong>Descripcion </strong>
                                        </td>
                                        <td style="width: 241px; text-align: left">
                                            :</td>
                                        <td style="width: 241px; text-align: left">
                                            <asp:TextBox ID="TxTDescMat" runat="server" Height="67px" Width="200px" TextMode="MultiLine"></asp:TextBox></td>
                                        <td style="width: 82px; text-align: justify">
                                            <strong>Cantidad </strong>
                                        </td>
                                        <td style="width: 82px; text-align: justify">
                                            :</td>
                                        <td>
                                            <asp:TextBox ID="TxTCantidadMat" runat="server" Width="200px"></asp:TextBox></td>
                                    </tr>
                                    <tr>
                                        <td style="width: 210px; height: 34px; text-align: justify">
                                            <strong>Valor Kg. </strong></td>
                                        <td style="width: 241px; height: 34px; text-align: left">
                                            :</td>
                                        <td style="width: 241px; height: 34px; text-align: left">
                                            <asp:TextBox ID="TxTValorMat" runat="server" Width="200px"></asp:TextBox></td>
                                        <td style="width: 82px; height: 34px; text-align: justify">
                                            <strong></strong></td>
                                        <td style="width: 82px; height: 34px; text-align: justify">
                                        </td>
                                        <td style="height: 34px">
                                            </td>
                                    </tr>
                                    <tr>
                                        <td colspan="6" style="width: 100%; height: 34px; text-align: center">
                                            <asp:Button ID="BtnIngresarMat" runat="server" Text="Ingresar" Width="100px" />
                                            <asp:Button ID="BtnLimpMat" runat="server" Text="Limpiar Sección" Width="112px" /></td>
                                    </tr>
                                    <tr>
                                        <td colspan="6" style="width: 100%; height: 34px; text-align: center">
                                <asp:Label ID="LabelAvisoMat" runat="server" Width="650px"></asp:Label></td>
                                    </tr>
                                    <tr>
                                        <td colspan="6" style="width: 100%; height: 34px; text-align: center">
                                            &nbsp;<asp:Panel ID="panelMat" runat="server" ScrollBars="Both" Width="100%" Height="200px">
                                <asp:GridView ID="GridMaterial" runat="server" AllowSorting="True" AutoGenerateColumns="False" CellPadding="4"
                                     ForeColor="#333333" GridLines="None"  Width="100%" CssClass="mGrid">
                                     <RowStyle BackColor="#EFF3FB" />
                                    <Columns>
                                        <asp:CommandField ShowDeleteButton="True" ButtonType="Image" DeleteImageUrl="~/Interfaz/Otros/Imagenes/delete-icon-md35.png" DeleteText="" HeaderText="Eliminar">
                                            <ItemStyle HorizontalAlign="Center" />
                                        </asp:CommandField>
                                        <asp:BoundField DataField="ID" HeaderText="Id">
                                            <ItemStyle HorizontalAlign="Center" />
                                        </asp:BoundField>
                                        <asp:BoundField DataField="ITEM" HeaderText="Item">
                                            <ItemStyle HorizontalAlign="Center" />
                                        </asp:BoundField>
                                        <asp:BoundField DataField="CANTIDAD" HeaderText="Cantidad">
                                            <ItemStyle HorizontalAlign="Center" />
                                        </asp:BoundField>
                                        <asp:BoundField DataField="DESCRIPCION" HeaderText="Descripcion">
                                            <ItemStyle HorizontalAlign="Center" />
                                        </asp:BoundField>
                                        <asp:BoundField DataField="VALORKG" HeaderText="Valor Kg.">
                                            <ItemStyle HorizontalAlign="Center" />
                                        </asp:BoundField>
                                        <asp:BoundField DataField="TOTNETO" HeaderText="Total Neto" >
                                            <ItemStyle HorizontalAlign="Center" />
                                        </asp:BoundField>
                                    </Columns>
                                    
                                </asp:GridView>
                                            </asp:Panel>
                                        </td>
                                    </tr>
                                </table>
                </td>
            </tr>
        </table>
       
    

    </form>
</body>
</html>
